﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btupload_Click(object sender, EventArgs e)
    {
        String filePath = Server.MapPath("~/img/") +  upload.FileName;
         upload.SaveAs(filePath);
         String s = filePath;
        datasever data=new datasever();
        SqlConnection conn = data.getconnect();
        SqlCommand cmd = new SqlCommand("sp_import_excel", conn);
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.Add(new SqlParameter("@FilePath",s));
        cmd.Parameters.Add(new SqlParameter("@TableName","test"));
        cmd.ExecuteNonQuery();
        conn.Close();
        Response.Write(s);
    }
    protected void btexport_Click(object sender, EventArgs e)
    {

    }
}